<?php


namespace app\btApi\controller;


use app\common\service\DepartmentService;
use app\common\utils\TreeUtils;
use hg\apidoc\annotation as Apidoc;
use think\facade\Db;
/**
 * @Apidoc\Title("部门相关")
 */
class Department
{
    private $departmentService;
    public function __construct()
    {
        $this->departmentService=new DepartmentService();
    }
    /**
     * @Apidoc\Title("部门接口")
     * @Apidoc\Desc("这里是一个描述")
     * @Apidoc\Url("btApi/department/list")
     * @Apidoc\Method("POST")
     * @Apidoc\Tag("登录")
     */
    public function list(){
        $list=Db::name('department')->select();
        $tree=TreeUtils::sort($list);
        print_r($tree);
    }
    public function treeList(){
        $this->departmentService->getTreeList();
    }
}